package com.zscat.mallplus.util;

import com.zscat.mallplus.util.applet.MD5;

import java.util.HashMap;

/**
 * @program: mallplus
 * @description:
 * @author: loop.fu
 * @create: 2020-03-03 09:26
 */
public class Kuaidi100 {
//    {
//        "message":"ok",
//            "state":"0",
//            "status":"200",
//            "condition":"F00",
//            "ischeck":"0",
//            "com":"yuantong",
//            "nu":"V030344422",
//            "data":[
//        {
//            "context":"上海分拨中心/装件入车扫描 ",
//                "time":"2012-08-28 16:33:19",
//                "ftime":"2012-08-28 16:33:19",
//        },
//        {
//            "context":"上海分拨中心/下车扫描 ",
//                "time":"2012-08-27 23:22:42",
//                "ftime":"2012-08-27 23:22:42",
//        }]
//    }
    public static void main(String[] args) throws Exception {
        String param = "{\"com\":\"***\",\"num\":\"***\"}";
        String customer = "***";
        String key = "****";
        String sign = MD5.getMessageDigest(param + key + customer);
        HashMap params = new HashMap();
        params.put("param", param);
        params.put("sign", sign);
        params.put("customer", customer);
        String resp;
        try {
            resp = HttpClientsUtil.httpPostBody("http://poll.kuaidi100.com/poll/query.do", 5000, params, "utf-8");
            System.out.println(resp);
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

}
